#include <iostream>
using namespace std;
int main ()
{


int num1, num2, n, suma, i, opcion;


cout << "Seleccione una opcion:" << endl;
cout << "1.Suma" << endl;
cout << "2.Resta" << endl;
cout << "3.Multiplicacion" << endl;
cout << "4.Division" << endl;
cout << "5.Salir" << endl;
cin >> opcion;

while (opcion != 5)
{
    switch (opcion)
    {
        case 1:
            i=0;
            suma=0;
            cout << "Ingrese numeros a sumar" << endl;
            cin >> n;

            while (i<n)
            {
                cout << "Ingrese numero" << endl;

                i=i+1;
                cin >> num1;
                suma=suma+num1;
            }
            cout << suma << endl;
            break;

        case 2:
            i=0;

            cout << "Ingrese numeros a restar" << endl;
            cin >> n;

            while (i<n)
            {
                cout << "Ingrese numero" << endl;
                cin >> num1;
                if (i==0)
                {
                    suma =num1;
                }
                else
                {
                    suma = suma - num1;
                }
                i=i+1;


            }
            cout << suma << endl;
            break;

        case 3:
            i=0;
            suma=0;
            cout << "Ingrese numeros a multiplicar" << endl;
            cin >> n;

            while (i<n)
            {
                cout << "Ingrese numero" << endl;

                i=i+1;
                cin >> num1;
                suma=suma*num1;
            }
            cout << suma << endl;
            break;

        case 4:
            i=0;
            suma=0;
            cout << "Ingrese numeros a dividir" << endl;
            cin >> n;

            while (i<n)
            {
                cout << "Ingrese numero" << endl;

                i=i+1;
                cin >> num1;

                suma=suma/num1;
            }
            cout << suma << endl;
            break;
    }

        cout << "Seleccione una opcion:" << endl;
        cout << "1.Suma" << endl;
        cout << "2.Resta" << endl;
        cout << "3.Multiplicacion" << endl;
        cout << "4.Division" << endl;
        cout << "5.Salir" << endl;
        cin >> opcion;

}
}
